package com.woniuxy.oa;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.woniuxy.oa.entity.Goods_claim;
import com.woniuxy.oa.mapper.EmployeeMapper;
import com.woniuxy.oa.mapper.Goods_claimMapper;
import com.woniuxy.oa.service.Goods_claimService;

@RunWith(SpringRunner.class)
@SpringBootTest
public class mytest {
	
	@Autowired
	Goods_claimMapper goods_claimMapper;
	
	@Autowired
	EmployeeMapper employeeMapper;
	
	@Autowired
	Goods_claimService goods_claimServiceImpl;
	//测试employee获取id
	@Test
	public void contextLoads() {
//		Timestamp d = new Timestamp(System.currentTimeMillis());
//		Goods_claim goods_claim=new Goods_claim("文具", 1, d, 0);
//		goods_claimMapper.insertGoods_claimGetGc_id(goods_claim);
//		System.out.println(goods_claim.getGc_id());
		System.out.println(goods_claimMapper.selectGoods_claimByGc_id(25));
		System.out.println(goods_claimMapper.selectGoods_claims());
		
	}
	
	@Test
	public void testmodifyGoods_claimByGc_id() {
		Date date=new Date();
//		SimpleDateFormat formatter=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//		String d = formatter.format(date);
		Goods_claim goods_claim=new Goods_claim();
		goods_claimServiceImpl.modifyGoods_claimByGc_id(goods_claim);
		
		
	}
	
	@Test
	public void testmodifyGoods_claim() {
		System.out.println(new Date());
		System.out.println(Calendar.getInstance().getTime());	
	}
	
	@Test
	public void testselectEmployeeIdByName() {
		List<Goods_claim> goods_claims = goods_claimMapper.selectEmployeeIdByName(null, 1, 10);
		System.out.println(goods_claims);
		System.out.println(goods_claims.get(0).getStay().getS_name());
		
	}
}
